﻿using Fast.Extensions.RabbitMQ;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using RabbitMQ.Client.Events;
using System.Threading.Tasks;

namespace Fast.Extensions.EventBus.RabbitMQ.Publish.Tests
{
    public class TestEventBus : FastEventBusRabbitMQ
    {
        public TestEventBus(IConnectionPool connectionPool, IOptions<FastRabbitMqEventBusOptions> options, IEventBusSubscriptionsManager subscriptionsManager, ILogger<FastEventBusRabbitMQ> logger)
            : base(connectionPool, options, subscriptionsManager, logger)
        {

        }

        protected override Task HandleBasicReturn(object sender, BasicReturnEventArgs basic)
        {
            Logger.LogInformation("override HandlerBasicReturn");
            return base.HandleBasicReturn(sender, basic);
        }

        protected override Task HandleNack(object o, BasicNackEventArgs basic)
        {
            Logger.LogInformation("override HandlerBasicNacks");
            return base.HandleNack(o, basic);
        }

        protected override Task HandleAck(object o, BasicAckEventArgs basic)
        {
            Logger.LogInformation("override HandlerBasicAcks");
            return base.HandleAck(o, basic);
        }
    }
}
